The present invention relates to a distance-measuring apparatus that determines the distance from the apparatus and an object, such as a car, by using light-sensitive devices with optical sensor arrays. More specifically, it relates to a distance-measuring apparatus with the capacity to detect defects resulting from malfunctions caused by condensation, cloud, or a foreign particle in light-sensitive windows or from defective elements in the optical sensor arrays.
In the drawings, reference numerals indicate the same or equivalent components throughout the specification.
Conventional techniques for measuring distances between vehicles are first described. Previous inter-vehicle distance-measuring apparatuses measure the distance electronically by comparing images formed by two laterally disposed optical systems and through triangulation.
FIG. 16 shows a conventional inter-vehicle distance-measuring apparatus. In this figure, image-forming lenses 1 and 2 are disposed so that their optical axes are separated at an interval B. Optical sensor arrays 3A and 4A are, for example, CCD linear sensor arrays and are disposed at a focusing distance (f) from the image-forming lenses 1 and 2. The optical sensor arrays 3A and 4A convert images of an object 16A formed by the image-forming lenses 1 and 2 into image signals 30A and 40A, and output to a signal processing section 5.
The signal processing section 5 is made of amplifiers 51 and 52, A/D converters 53 and 54, and a storage device 55. The image signals 30A and 40A from the optical sensor arrays 3A and 4A are amplified by the amplifiers 51 and 52, converted into digital data by A/D converters 53 and 54, and sent to storage device 55 as image data 31A and 41A.
A distance detection circuit 6 disposed at the output of the signal processing section 5 is made of a microcomputer that compares right and left image data 31A and 41A stored in the storage device 55 to calculate the distance from the object 16A, and outputs a distance signal 11.
FIG. 17 is then used to describe a principle for calculating the distances. The midpoints of the image-forming lenses 1 and 2 is defined an origin O to set a horizontal axis X and a vertical axis Y, and the coordinates of image-forming positions L.sub.1 and R.sub.1 are referred to as (-a.sub.L1 -B/2,-f) and (a.sub.R1 +B/2, -f). a.sub.L1 and a.sub.R1 are distances on the optical sensor arrays 3A and 4A, as shown in the figure.
The coordinates of the midpoint O.sub.L of the image-forming lens 1 are (-B/2, 0), while the coordinates of the midpoint O.sub.R of the image-forming lens 2 are (B/2, 0). When the coordinates of a point M in the object 16A are referred to as (x, y), the coordinates of the intersection N of a vertical line extending from the point M to the X axis are (x, 0), the coordinates of a position L.sub.o of a vertical line extending from the point O.sub.L to the optical sensor array 3A are referred to as (-B/2, -f), and the coordinates of a position R.sub.o of a vertical line extending from the point O.sub.R to the optical sensor array 4A are referred to as (B/2, -f). In this case, since .DELTA.MO.sub.L N is similar to .DELTA.O.sub.L L.sub.1 L.sub.o and .DELTA.MO.sub.R N is similar to .DELTA.O.sub.R R.sub.1 R.sub.o, the following Equations 1 and 2 can be established. EQU (x+B/2)f=(a.sub.L1 +B/2-B/2)y Equation 1 EQU (-x+B/2)f=(a.sub.R1 +B/2-B/2)y Equation 2
Equation 3 can be obtained from Equations 1 and 2. By using Equation 3 to determine the distances a.sub.L.sub.1 and a.sub.R1 for the image-forming positions L.sub.1 and R.sub.1, the distance (y) from the object 16A can be calculated. EQU y=B.multidot.f/(a.sub.L1 +a.sub.R1) Equation 3
Next, the operation of a distance detection circuit 6 is described. The distance detection circuit 6 compares right and left image data 3AL and 4AR for separately set measuring windows as shown by the solid lines in FIG. 18. If the images do not match, it sequentially shifts the left image data 3AL right and the right image data 4AR left as shown by the broken lines in FIG. 18. When the right and left image data matches, it calculates the amount of the necessary shift.
To determine whether the right and the left image data 3AL and 4AR matches, the following evaluation function is used. The evaluation function is the sum of the absolute values of the differences between pixel data from pixels (in this example, CCD elements) located at corresponding coordinates in measuring windows set in the right and the left optical sensor arrays 3A and 4A, for all pixels in the measuring windows. The value of this evaluation function is examined by sequentially shifting the right and the left measuring windows: shifting the left measuring window left (thus, the left image data 3AL is equivalently shifted right) while shifting the right measuring window right (thus, the right image data 4AR is equivalently shifted left). It is determined that the right and left image data matches when the function value is at its lowest.
The distances a.sub.L1 and a.sub.R1 for the right and left image-forming positions L.sub.1 and R.sub.1 equal to the amount of the shift, so the distance detection circuit 6 uses Equation 3 to calculate the distance (y) from the object 16A based on the amounts of the shift a.sub.L1 and a.sub.R1.
FIG. 19 provides an image obtained under normal conditions in detecting the distance from a preceding car 16. In this figure, a distance-measuring range 23 is set within a visual field 22, and the distance from the object (preceding car 16) in the distance-measuring range 23 is detected as an inter-vehicle distance based on the principle of the distance detection.
This conventional technique has the following problems. In addition to the preceding car, there are guideposts and painted patterns of the cross-walks on the roads as shown in FIG. 20, and the device often measures these things appearing in the field of a view 23. Many guideposts and signboards appear alongside the road. In particular, when the road is curved, such objects often appear at the center of the visual field and are mistaken as a car. It is crucial that an apparatus correctly identifies and outputs the distance information only for the preceding car.
To meet this requirement, the apparatus uses an object recognition method by an image processing procedure that extracts and binarizes edges from the image data provided by the variable-density image information from a CCD sensor, before carrying out an area division for the object recognition.
But such an image processing is time-consuming, requiring preprocessing, such as noise removal by filtering a variable-density image, before binarization and extraction of the edges based on the differences among images. Incorporating a faster image processor increases cost and size beyond the practical levels.
One attempt to overcome this difficulty is illustrated in Japanese Patent Application Laid Open No. 8-210848, predecessor to this application (referred hereafter as the first application). The technique used in the first application is incorporated in the application and is briefly described here. This technique attempts a stable, simple and accurate determination of the distance from an object in front of the apparatus by using light-sensitive devices with optical sensor arrays, thereby reducing costs of the distance-measuring apparatus.
FIG. 6 provides a structure of an inter-vehicle distance-measuring apparatus to which the first application is applied. Here, a preceding car 16 travels in the same lane as the car equipped with the apparatus.
The image-forming lenses 1 and 2 are disposed so that their optical axes are separated at an interval B, and the light-sensitive devices 3 and 4 are disposed at the focusing distance (f) (not shown for convenience). Light-sensitive device 3 is composed of (m) optical sensor arrays 31 to 3m disposed parallel in a plane perpendicular to the optical axis, while light-sensitive device 4 similarly composed of (m) optical sensor arrays 41 to 4m disposed parallel in a plane perpendicular to the optical axis, so that 31 and 41, 3i and 4i, and 3m and 4m have the same visual fields, respectively.
An image of the object formed by the image-forming lens 1 is converted into image signals 30l to 30m by the optical sensor arrays 3l to 3m, while an image of the object formed by the image-forming lens 2 is converted into image signals 40l to 40m by the optical sensor arrays 4l to 4m. The signals are then sent to a signal processing section 5.
The signal processing section 5 is composed of amplifiers 51l to 51m and 52l to 52m, A/D converters 53l to 53m and 54l to 54m, and a storage device 55. Image signals 301 to 30m from the optical sensor arrays 31 to 3m of the light-sensitive device 3 are amplified by the amplifiers 511 to 51m, converted into digital data by the A/D converters 531 to 53m, and stored in the storage device 55 as the image data 311 to 31m.
Likewise, the image signals 401 to 40m from the optical sensor arrays 41 to 4m of the light-sensitive device 4 are amplified by the amplifiers 521 to 52m, converted into digital data by the A/D converters 541 to 54m, and stored in the storage device 55 as the image data 411 to 41m.
As in FIG. 16, the distance detection circuit 6 is a microcomputer that calculates the distance from the object within the distance-measuring range in the measuring visual fields of the optical sensor arrays 31, 41, 3i, 4i, 3m and 4m, from the right and left image data 311, 411,, 31i, 41i, 31m and 41m stored in the storage device 55.
A distance block diagram extraction section 7 divides the distance-measuring range 23 within the measuring visual field 22 into m.times.n (m: a natural number indicating the number of the optical sensor arrays on one side; n: a natural number indicating the number of the measuring windows in the optical sensor arrays) distance blocks with addresses to create a distance block diagram 24 with a collection of the measuring distance information in each block, as shown in FIGS. 10 and 11. This distance block diagram is a collection of m.times.n distance measured data.
For example, a case, in which the number (m) of the optical sensor arrays is 7 and the number of the measuring windows in the longitudinal direction of the optical sensor arrays is 12, is described with reference to FIGS. 10 and 11. In this figure, optical sensor arrays A1 to A7 are disposed in this order from the top of the distance measuring range 23, measuring points W1 to W12 in the longitudinal direction of the optical sensor arrays are disposed in order from left, and the measured distance at the measuring point Wj on the optical sensor array Ai is referred to as Lij. In the example, the distance for 7.times.12 blocks within the measuring visual field 22 can be detected, and as a result, the distance block diagram 24 is extracted.
FIG. 12 is used to describe a principle for measuring distances for a plurality of points in the optical sensor arrays. The distance-measuring apparatus here has the same structure as in FIG. 16, except that each sensor array is partitioned into a plurality of regions (measuring windows). FIG. 12 shows the case, wherein the optical sensor array is partitioned into regions (1), (2) and (3).
The measuring window regions (1), (2) and (3) may be set so that some optical sensor elements (in this case, CCD elements) partly constituting the optical sensor arrays are subjected to overlap between the corresponding measuring window regions (that is, some CCD elements belong to two adjacent measuring window regions).
It is assumed that objects O.sub.1, O.sub.2 and O.sub.3 for which the distance is to be measured are disposed in three directions relative to the distance-measuring apparatus shown by alternate long and short dash lines (that is, the direction of the center line and two directions on both sides of the center line at an angle .alpha.), and that objects are located at distances L.sub.1, L.sub.2 and L.sub.3, respectively. The regions (1), (2) and (3) in each of the optical sensor arrays 3 and 4 correspond to the objects O.sub.1, O.sub.2 and O.sub.3.
In other words, an image of the object O.sub.1 located on the left of the center line at an angle .alpha. is simultaneously formed on the regions (1) in the pair of optical sensor arrays 3 and 4, an image of the object O.sub.2 located on the center line is simultaneously formed on the regions (2) in the pair of optical sensor arrays 3 and 4, and an image of the object O.sub.3 located on the right of the center line at an angle .alpha. is simultaneously formed on the regions (3) in the pair of optical sensor arrays 3 and 4. The distances L.sub.1, L.sub.2 and L.sub.3 from the objects O.sub.1, O.sub.2 and O.sub.3 can be expressed by the following Equations 4 to 6. Distances B, f, U11, U12, U13, U21, U22 and U23 in these equations are shown in FIG. 12. EQU L.sub.1 =B.multidot.f/(U21-U11) Equation 4 EQU L.sub.2 =B.multidot.f/(U22+U12) Equation 5 EQU L.sub.3 =B.multidot.f/(U13-U23) Equation 6
Since each degree of shift (U21, U11, U22, U12, U13 and U23) can be determined by the distance detection circuit 6 based on the image data on the optical sensor arrays 3 and 4, Equations 4 to 6 can be used to determine the distances L.sub.1, L.sub.2 and L.sub.3.
A distance signal 12 from the distance block diagram extraction section 7 obtained in this way is sent to a distance selection section 8 in FIG. 6. The distance selection section 8 determines a distance frequency distribution of the distances in the distance signals 12, selects from the distance signals 12 only the distance from the preceding car 16, and sends it to a travel average processing section 9 as a distance signal 13.
Next, the operational principle of the distance selection section 8 is described with reference to FIG. 13. In FIG. 13, the horizontal axis indicates distance classes K divided based on a class width .DELTA.L while the vertical axis indicates a frequency distribution value belonging to each class. The distance signal 12 is fractionized or classified in this manner. As shown in FIG. 14, the area in the distance-measuring range 23 occupied by the preceding car 16 depends on the distance between the device and the preceding car 16, so that the number of measured data presumably used to measure the distance from the preceding car 16 depends on the inter-vehicle distance.
In general, when the inter-vehicle distance increases (n)-fold, the area in the measuring range occupied by the preceding car 16 becomes (1/n).sup.2 based on similarity. That is, the number of measured data used to measure the distance from the preceding car 16 is easily estimated at (1/n ).sup.2.
Thus, the number of measured data used to measure the distance from the preceding car 16 (frequency distribution value) can be given by Equation 7 . EQU Y=a/K.sup.2 (Y: frequency distribution value, a: constant, K: distance class (distance)) Equation 7
The constant (a) is determined by the size of the preceding car 16 and the shape of the distance-measuring apparatus. The description of a specific method for determining the constant is omitted. A curve or value Y is delineated by the broken line in FIG. 13, and median L (=(K2+K3) /2) of the distance class K with a frequency distribution value extending up to the upper region of the curve Y is used as a candidate for the distance from the preceding car 16 and is outputted to a travel average processing section 9 as a distance signal 13.
Based on the distance signal 13, the travel average processing section 9 performs travel average processing within the 7.times.12 distance blocks, and transmits to a preceding car recognition section 10 (i.e. preceding object recognition section) a distance average at each travel average location and the results 14 of the travel average processing with a standard deviation/distance average thereat.
The operational principle of travel average processing is described by using FIG. 15. First, the size of the distance blocks i.times.j (i: m or a smaller natural number, j: n or a smaller natural number) for which a travel average is determined from the distance signal 13 (median L of the distance classes) is determined. The size of the distance blocks is determined by the inter-vehicle distance from the preceding car 16 based on the distance signal 13, the size of the preceding car 16, and the shape of the distance-measuring apparatus.
The travel average processing is explained here in reference to the 7.times.12 distance block diagram described above. If the size of the distance blocks for which a travel average is determined is 3.times.6, the results of the travel average processing for FIG. 15(A) can be expressed by FIGS. 15(B) to 15(D). When the measured distance on the i-th sensor array in the j-th window position is referred to as Lij, Aij, Sij, and Dij in FIGS. 15(B). 15(C) and 15(D) can be expressed by following Equations 8 to 10. EQU Aij={.sup.i+2,j+5 .SIGMA..sub.i,j (L.sub.ij)}/(3.times.6)=AVGEquation 8 EQU Sij={.sup.i+2,j+5 .SIGMA..sub.i,j (L.sub.ij -AVG).sup.2 }/(3.times.6)!.sup.1/2 Equation 9 EQU Dij=Sij/Aij Equation 10
AVG in Equation 8 indicates a distance average.
For example, the average of the distances in the oblique line region in FIG. 15(A) is indicated by the oblique line region in FIG. 15(B), the standard deviation is indicated by the oblique line part in FIG. 15(C), and the standard deviation/distance average is indicated by the oblique line part in FIG. 15(D).
The preceding car recognition section 10 as a preceding object recognition section is connected to the travel average processing section 9 to determine whether the measured object in front of the apparatus is the preceding car 16, based on the distance average, standard deviation, and standard deviation/distance average as the results of a travel average processing 14 transmitted from the travel average processing section 9.
This determination uses the Dij value for the upper-left-most Lij of the distance blocks for which a travel average is determined. If this value is smaller than a certain standard value (b), it is determined that the preceding car is at the inter-vehicle distance expressed by the distance average Aij at a travel average location in Lij, and the location of the preceding car 16 and the inter-vehicle distance from the preceding car 16 are sent to an external alarm device as information 15 on the preceding car.
FIG. 7 shows a flow chart of the processing used in the example above. The distance detection circuit 6 uses the data in the storage device 55 in the signal processing section 5 to calculate m.times.n measured distance information (S1); based on this information, the distance block diagram extraction section 7 creates a distance block diagram (S2).
The distance selection section 8 subsequently determines a distance frequency distribution (S3) and extracts the median L of the distance classes K (S4).
The travel average processing section 9 determines the size i.times.j of the distance blocks for which a travel average is determined based on the median L (S5), and determines the travel average of the m.times.n area (S6).
Next, the travel average processing section 9 calculates a distance average, standard deviation, and standard deviation/distance average at each travel average location and transmits this data to a preceding car recognition section 10 (S7).
The preceding car recognition section 10 compares the standard deviation/distance average with a standard value (b) (S8). If it determines that there is a car in front of the apparatus (S91), the preceding car recognition section 10 outputs the travel average location and distance average as the location of the preceding car and distance from the preceding car, respectively (S10). If it determines that there is no car in front of the apparatus (S92), the processing is finished.
For reliable capture of the preceding car 16, the measuring visual field should be as large as possible. To this end, the longitudinal length of the optical sensor arrays may be increased, or many pairs of optical sensor arrays may be employed. But such a method increases the size of the apparatus and provides significantly faded images at the ends of the light-sensitive device due to aberration of the image-forming lens, resulting in degradation and requiring further complications in the processing circuits, such as amplifiers, A/D converters.
Thus, in the example of the structure in FIG. 8, the distance-measuring apparatus 01 has an optical axis that oscillates radially. In FIG. 8, a control circuit section 18 is connected to a distance-measuring apparatus oscillating motor 17 and a signal processing section 5 to transmit control signals 19 and 20 to the motor 17 and the signal processing section 5. The motor 17 is mechanically linked to the distance-measuring apparatus body 01 to oscillate the distance-measuring apparatus body 01 based on the control signal 19, so that the optical axis of the body oscillates radially.
In the illustrative structure in FIG. 9, the distance-measuring apparatus is composed of a distance-measuring apparatus body 01 disposed in place and a reflecting mirror 21, oscillating to allow light to be radially incident on the distance-measuring apparatus body 01. A control circuit section 18 is connected to a reflecting mirror driving motor 17 and a signal processing section 5 to output control signals 19 and 20 to the motor 17 and the signal processing section 5. The motor 17 is mechanically linked to the reflecting mirror 21 to oscillate the reflecting mirror 21 based on the control signal 19 in order to allow light to be radially incident on the distance-measuring apparatus body 01.
Techniques for identifying the regions within the visual fields of the light-sensitive devices 3 and 4 in which the preceding car is present include the proposal in Japanese Patent Application Laid Open No. 7-280563 that is a previous application of the applicant (referred hereafter as the second previous application), as well as the first application described above. The second previous application is briefly described. A line detection section detects as a lane the image at a location on each optical sensor array of at least one of the light-sensitive devices at which light quantity distribution has a maximum value. Next, a distance-measuring range detection section detects a possible horizontal location range for the preceding car based on a signal from the line detection section indicating the location of the line. Then, by triangulation, the distance detection section calculates an inter-vehicle distance based on a location within the possible location range at which an image of the preceding car is formed.
The line detection method incorporates the following three methods. The first method detects as a line an image obtained when an image-formed location that has a maximum value of a light quantity distribution is maintained within a set range for a set period of time. The second method detects as a line an image obtained when a straight line joining those image-formed locations on the two optical sensor arrays passes through a range set around those image-formed locations on other optical sensor arrays, which also have maximum values for a light quantity distribution. The third method detects as a line an image obtained when the width of an object determined from (a) the distance from the object determined from the image-formed location having a maximum value of a light quantity distribution and (b) the width of the images is within a set range. A line, as referred to here, includes white lines and others, including, for example yellow lines.
In the distance-measuring apparatus described above, if visibility is reduced by condensation or fouling of lenses or protective transparent cover glasses, a distance-measuring may become inaccurate or even impossible. If an optical sensor element, i.e. CCD element, as a pixel in the optical sensor arrays is defective, any evaluation function using an output from this defective element is invalid and prevents accurate distance calculation.
One object of this invention is to overcome these difficulties and to provide a distance-measuring apparatus capable of accurately calculating distances.